package org.hgg.workflow.core;

import java.util.Objects;

/**
 * @author Jarvis
 * @date 2023/12/28 0:22
 */
public class ExecutionResult <T, R>{

    private Node<T, R> node;

    private R result;

    private boolean success;


    public boolean isSuccess(){
        return false;
    }

    public R getResult() {
        return result;
    }

    public ExecutionResult(Node<T, R> node, R result, boolean success) {
        this.node = node;
        this.result = result;
        this.success = success;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ExecutionResult<?, ?> that = (ExecutionResult<?, ?>) o;
        return Objects.equals(node, that.node);
    }

    @Override
    public int hashCode() {
        return Objects.hash(node);
    }
}
